/**
 * 
 */
package com.cwnuzj.ffms.model.navigation;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Jeff.Zheng
 * 
 */
public class NavTreeData {

	/**
	 * 记录node节点和相应editorId的对应关系
	 */
	private Map<String, ActionEditorData> editorsMap = new HashMap<String, ActionEditorData>();

	public List<Category> getCategories() {
		List<Category> categories = new ArrayList<Category>();
		Category category = new Category();
		category.setName("收支");
		categories.add(category);
		TreeNodeObject node = new TreeNodeObject("收支管理");
		category.getNodes().add(node);
		editorsMap.put(node.getName(), new ActionEditorData("com.cwnuzj.ffms.openAccountBookEditor", "com.cwnuzj.ffms.accountbook.editor"));

		node = new TreeNodeObject("收支统计");
		category.getNodes().add(node);
		editorsMap.put(node.getName(), new ActionEditorData());

		category = new Category();
		category.setName("设置");
		categories.add(category);
		node = new TreeNodeObject("家庭成员");
		category.getNodes().add(node);
		editorsMap.put(node.getName(), new ActionEditorData("com.cwnuzj.ffms.openUsersEditor","com.cwnuzj.ffms.users.editor"));

		node = new TreeNodeObject("账号信息");
		category.getNodes().add(node);
		editorsMap.put(node.getName(), new ActionEditorData());

		node = new TreeNodeObject("收入类型");
		category.getNodes().add(node);
		editorsMap.put(node.getName(), new ActionEditorData());

		node = new TreeNodeObject("支出类型");
		category.getNodes().add(node);
		editorsMap.put(node.getName(), new ActionEditorData());

		return categories;
	}

	/**
	 * @return the editorsMap
	 */
	public Map<String, ActionEditorData> getEditorsMap() {
		return editorsMap;
	}

	/**
	 * @param editorsMap
	 *            the editorsMap to set
	 */
	public void setEditorsMap(Map<String, ActionEditorData> editorsMap) {
		this.editorsMap = editorsMap;
	}

	public class ActionEditorData {
		String commandId;
		String editorId;

		public ActionEditorData() {
		}

		public ActionEditorData(String commandId, String editorId) {
			this.commandId = commandId;
			this.editorId = editorId;
		}

		/**
		 * @return the commandId
		 */
		public String getCommandId() {
			return commandId;
		}

		/**
		 * @param commandId
		 *            the commandId to set
		 */
		public void setCommandId(String commandId) {
			this.commandId = commandId;
		}

		/**
		 * @return the editorId
		 */
		public String getEditorId() {
			return editorId;
		}

		/**
		 * @param editorId
		 *            the editorId to set
		 */
		public void setEditorId(String editorId) {
			this.editorId = editorId;
		}

	}

}
